import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/index/deptManager'
  },
  {
    path: '/index',
    name: 'index',
    component: () => import("../views/index.vue"),
    redirect: '/index/deptManager',
    children: [
      {
        path: 'deptManager',
        name: 'deptManager',
        component: () => import("../components/HRmanager/deptManage.vue")
      },
      {
        path: 'employeeManager',
        name: 'employeeManager',
        component: () => import("../components/HRmanager/employeeManage.vue")
      },
      {
        path: 'holidayManager',
        name: 'holidayManager',
        component: () => import("../components/HRmanager/holidayManager.vue")
      },
      {
        path: 'account',
        name: 'account',
        component: () => import("../components/FinanceManager/Account.vue")
      },
      {
        path: 'accountmaintain',
        name: 'accountmaintain',
        component: () => import("../components/SystemManager/AccountMaintain.vue")
      },
      {
        path: 'roleManager',
        name: 'roleManager',
        component: () => import("../components/SystemManager/RoleManager.vue")
      },
      {
        path: 'preManager',
        name: 'preManager',
        component: () => import("../components/SystemManager/PreManager.vue")
      },
      {
        path: 'resetAccount',
        name: 'resetAccount',
        component: () => import("../components/SystemManager/resetAccount.vue")
      }
    ]
  },
  {
    path: '/Login',
    name: 'Login',
    component: () => import("../views/Login.vue"),
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
